package org.codeart.strategy.example01;

/**
 * 上下文类
 */
public class Context {

    // 维护一个抽象策略的引用
    private final Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 调用策略类的算法
     */
    public void algorithm() {
        strategy.algorithm();
    }
}
